import request from '@/router/axios';
//生产设备采购计划
//生产设备采购计划列表
export const getProEquipmentList = (params) => {
  return request({
    url: '/api/hg-public/equipmentpurchaseplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//更新生产设备采购计划
export const updateProEquipment = (row) => {
  return request({
    url: '/api/hg-public/equipmentpurchaseplan/update',
    method: 'post',
    data: row
  })
}

//获取生产设备采购计划
export const getProEquipment = (id) => {
  return request({
    url: '/api/hg-public/equipmentpurchaseplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//检验设备采购计划
//检验设备采购计划列表
export const getCheckEquipmentList = (params) => {
  return request({
    url: '/api/hg-public/testingpurchaseplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//更新检验设备采购计划
export const updateCheckEquipment = (row) => {
  return request({
    url: '/api/hg-public/testingpurchaseplan/update',
    method: 'post',
    data: row
  })
}

//获取检验设备采购计划
export const getCheckEquipment = (id) => {
  return request({
    url: '/api/hg-public/testingpurchaseplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//模具备件采购计划
//模具备件采购计划列表
export const getMouldSpareList = (params) => {
  return request({
    url: '/api/hg-public/mouldspareplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//更新模具备件采购计划
export const updateMouldSpare = (row) => {
  return request({
    url: '/api/hg-public/mouldspareplan/update',
    method: 'post',
    data: row
  })
}

//获取模具备件采购计划
export const getMouldSpare = (id) => {
  return request({
    url: '/api/hg-public/mouldspareplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}
//检具采购计划
//检具采购计划列表
export const getFixtureList = (params) => {
  return request({
    url: '/api/hg-public/checktoolbuyplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//更新检具采购计划
export const updateFixture = (row) => {
  return request({
    url: '/api/hg-public/checktoolbuyplan/update',
    method: 'post',
    data: row
  })
}

//获取检具采购计划
export const getFixture = (id) => {
  return request({
    url: '/api/hg-public/checktoolbuyplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}
//工位器具采购计划
//工位器具采购计划列表
export const getWorkappList = (params) => {
  return request({
    url: '/api/hg-public/workposbuyplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//更新工位器具采购计划
export const updateWorkapp = (row) => {
  return request({
    url: '/api/hg-public/workposbuyplan/update',
    method: 'post',
    data: row
  })
}

//获取工位器具采购计划
export const getWorkapp = (id) => {
  return request({
    url: '/api/hg-public/workposbuyplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}


//原材料采购计划
//原材料采购计划列表
export const getMaterialPlanList = (params) => {
  return request({
    url: '/api/hg-public/rawmaterialplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

//更新原材料采购计划
export const updateMaterialPlan = (row) => {
  return request({
    url: '/api/hg-public/rawmaterialplan/update',
    method: 'post',
    data: row
  })
}

//原材料采购计划详情
export const getMaterialPlan = (id) => {
  return request({
    url: '/api/hg-public/rawmaterialplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//辅助材料采购计划
//辅助材料采购计划列表
export const getAuxMaterialPlanList = (params) => {
  return request({
    url: '/api/hg-public/auxiliarymaterialplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

//更新辅助材料采购计划
export const updateAuxMaterialPlan = (row) => {
  return request({
    url: '/api/hg-public/auxiliarymaterialplan/update',
    method: 'post',
    data: row
  })
}

//辅助材料采购计划详情
export const getAuxMaterialPlan = (id) => {
  return request({
    url: '/api/hg-public/auxiliarymaterialplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}


//外购件计划
//外购件计划列表
export const getOutPurchasePlanList = (params) => {
  return request({
    url: '/api/hg-public/outsourcingplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}
//新增外购件计划
export const addOutPurchasePlan = (row) => {
  return request({
    url: '/api/hg-public/outsourcingplan/save',
    method: 'post',
    data: row
  })
}

//更新外购件计划
export const updateOutPurchasePlan = (row) => {
  return request({
    url: '/api/hg-public/outsourcingplan/update',
    method: 'post',
    data: row
  })
}
//删除外购件计划
export const removeOutPurchasePlan = (projectNo, productDrawingNo) => {
  return request({
    url: '/api/hg-public/outsourcingplan/remove',
    method: 'post',
    params: {
      projectNo, productDrawingNo
    }
  })
}
//外购件计划详情
export const getOutPurchasePlan = (params) => {
  return request({
    url: '/api/hg-public/outsourcingplan/getOutsourcing',
    method: 'get',
    params: {
      ...params
    }
  })
}


//外协件计划
//外协件计划列表
export const getOutSourcingPlanList = (params) => {
  return request({
    url: '/api/hg-public/outreachplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

//更新外协件计划
export const updateOutSourcingPlan = (row) => {
  return request({
    url: '/api/hg-public/outreachplan/update',
    method: 'post',
    data: row
  })
}

//外协件计划详情
export const getOutSourcingPlan = (id) => {
  return request({
    url: '/api/hg-public/outreachplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}

//人员配置计划
//人员配置计划列表
export const getStaffPlanList = (params) => {
  return request({
    url: '/api/hg-public/personrequireplan/list',
    method: 'get',
    params: {
      ...params
    }
  })
}

//更新人员配置计划
export const updateStaffPlan = (row) => {
  return request({
    url: '/api/hg-public/personrequireplan/update',
    method: 'post',
    data: row
  })
}
//获取所有岗位
export const getPostTree = (id) => {
  return request({
    url: '/api/hg-public/personrequireplan/getPost',
    method: 'get',
    params: {
      id
    }
  })
}
//人员配置计划详情
export const getStaffPlan = (params) => {
  return request({
    url: '/api/hg-public/personrequireplan/detail',
    method: 'get',
    params: {
      ...params
    }
  })
}


//PO订单发货计划
//PO订单发货计划列表
export const getPOPlanList = (params) => {
  return request({
    url: '/api/hg-public/poshipplan/page',
    method: 'get',
    params: {
      ...params
    }
  })
}
//新增/更新PO订单发货计划
export const addPOPlan = (row) => {
  return request({
    url: '/api/hg-public/poshipplan/submit',
    method: 'post',
    data: row
  })
}
//新增/更新PO订单发货计划
export const updatePOPlan = (row) => {
  return request({
    url: '/api/hg-public/poshipplan/submit',
    method: 'post',
    data: row
  })
}

//删除PO订单发货计划
export const removePOPlan = (ids) => {
  return request({
    url: '/api/hg-public/poshipplan/remove',
    method: 'post',
    params: {
      ids
    }
  })
}
//PO订单发货计划详情
export const getPOPlan = (id) => {
  return request({
    url: '/api/hg-public/poshipplan/detail',
    method: 'get',
    params: {
      id
    }
  })
}
